package com.xu.mode.factory;

//计算方法工厂
public class CalculationFactory {
    public static Calculation getCalculationFunction(String function) {
        switch (function) {
            case "+":
                return new CalculationAdd();
            case "-":
                return new CalculationSub();
            case "*":
                return new CalculationMul();
            case "/":
                return new CalculationDiv();
        }
        return null;
    }
}
